home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-30 | 43.1 KB | 1,233 lines |
- C.S.M.P. Digest Fri, 15 May 92 Volume 1 : Issue 81
-
- Today's Topics:
-
- TextWidth and LaserWriters
- MacBinary source
- Problems with ResEdit2.1
- Think C, TCL, AppleTalk Async calls and a question
- Anybody know the SE "Easter Egg?"
- debugging tools for lisp
- Network copy protection problems
- Problem with PBHGetFInfo
- Regular reading of a serial device-how?
- How to read 10 sectors per track on floppy? (Repost)
- WWDC Dinner?
- archive site for Frontier stuff?
- What is Discipline?
- 32K boundary problem?
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- These digests are available (by using FTP, account anonymous, your email
- address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
- edu. This is also the home of the comp.sys.mac.programmer Frequently Asked
- Questions list. The last several issues of the digest are available from
- sumex-aim.stanford.edu as well.
-
- These digests are also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new digest as it is created.
-
- The digest is a collection of articles from the internet newsgroup comp.sys.
- mac.programmer. It is designed for people who read c.s.m.p. semi-regularly
- and want an archive of the discussions. If you don't know what a newsgroup
- is, you probably don't have access to it. Ask your systems administrator(s)
- for details. (This means you can't post questions to the digest.)
-
- The articles in these digests are taken directly from comp.sys.mac.programmer.
- They are not edited; all articles included in this digest are in their original
- posted form. The only articles that are -not- included in these digests are
- those which didn't receive any replies (except those that give information
- rather than ask a question). All replies to each article are concatenated
- onto the original article in the order in which they were received. Article
- threads are not added to the digests until the last article added to the
- thread is at least one month old (this is to ensure that the thread is dead
- before adding it to the digests).
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
- -------------------------------------------------------
-
- From: Paul.L.Merchant.Jr.@dartmouth.edu (Paul L Merchant Jr.)
- Subject: TextWidth and LaserWriters
- Date: 9 Apr 92 13:16:40 GMT
- Organization: Dartmouth College, Hanover, NH
-
- I'm having trouble spacing text properly on a LaserWriter. I'm trying
- to draw two strings, the second following the first by x "pixels". The
- procedure I'm using looks like this:
-
- MoveTo(startx, starty);
- DrawText(text1);
- Move(x, 0);
- DrawText(text2);
-
- The problem is that apparently the LaserWriter's idea of the pen
- location after the first DrawText is different from the GrafPort's idea
- of the pen's location. So the space between text1 and text2 is much
- larger than I want. The effect seems to vary with the font choice with
- the reproduction being best if I have chosen a LaserWriter font such as
- Helvetica. (This code is part of an application which allows the user
- to select any available font.)
-
- The problem is really dramatic if the following lines are added after
- the first DrawText:
-
- Line(0, -10);
- Move(0, 10);
-
-
- This should draw a vertical line immediately after the text, right?
- Wrong. Instead I get a diagonal line whose width is equal to the error
- between the different measurements.
-
- I have tried using SetFractsEnable set to both true and false, and I
- have tried Font Subtitution and Text Smoothing enabled and disabled.
- All have an effect on the problem, but none cure it.
-
- My questions then are:
-
- 1. Is there any way to discover the "true" pen location when printing
- since it does not appear to be available using GetPen?
-
- 2. If not, is there a way to discover what the actual printed text
- width is? I have compared the results of TextWidth(text1) within the
- printing GrafPort and a screen GrafPort and they are the same. I have
- also used the global font width table to compute my own text widths and
- still found no difference.
-
- 3. Is there any way to find out what font the LaserWriter is
- substituting when it is drawing?
-
- 4. Is there another way to make the spacing between text1 and text2
- accurate? (There must be some way, or word processors would never be
- able to do justification.)
-
- 5. Is there any documentation about this anywhere?
-
- And on a related topic:
-
- 6. How can I find out which fonts are "fixed width"? I thought about
- looking at the fontType field of the font record until I discovered
- that it described Monaco as a proportional font even though it appears
- to be fixed width.
-
- Thanks in advance for any help you can give me!
-
- Paul Merchant
- Paul.Merchant@Dartmouth.EDU
-
- +++++++++++++++++++++++++++
-
- From: CXT105@psuvm.psu.edu (Christopher Tate)
- Date: 14 Apr 92 18:19:27 GMT
- Organization: Penn State University
-
- You need to read, carefully and patiently, the Tech Notes that discuss
- printing in general, and LaserWriters in particular. I don't recall just
- which Tech Notes they are, but the numbers 92 and 86 stick in my mind.
- Get the index (or the Tech Notes Stack), and go from there.
-
- Basically, when you print text to the LaserWriter all manner of strange
- and wonderous things may happen, such as Font Substitution, which will
- play merry hell with the actual position of text and other graphics on
- the page. Get the tech notes and study them, and experiment a lot.
-
- And be glad you don't have to pay $0.25 per page when experimenting,
- the way I did.... :-(
-
- - -------
- Christopher Tate | "Computer Science has more real-world
- | applications than rotisserie baseball."
- cxt105@psuvm.psu.edu |
- Bitnet: CXT105@PSUVM | -- Ben Liblit, next-door neighbor
-
- ---------------------------
-
- From: francois@welchgate.welch.jhu.edu (Francois Schiettecatte)
- Subject: MacBinary source
- Date: 10 Apr 92 21:02:32 GMT
- Organization: Johns Hopkins Univ. Welch Medical Library
-
- Hi
-
- I am looking for C source to convert MacBinary files downloaded
- from a Unix box to a proper mac file. Ideally this source
- should be public domain, can anybody give me any pointers?
-
-
- francois
-
-
-
- Francois Schiettecatte
- Internet: francois@library.welch.jhu.edu
- Phone : (410) 955-7581
-
- +++++++++++++++++++++++++++
-
- From: mwalker@wc.novell.com (Mel Walker)
- Organization: Novell, Inc. - Walnut Creek
- Date: Tue, 14 Apr 1992 14:40:26 GMT
-
- Does anyone out there know of a site from which I can download the source
- code for doing MacBinary file conversion? I would much appreciate it.
- Thanks,
- - --Mel Walker mwalker@optics.wc.novell.com
-
- ---------------------------
-
- From: pdt@unix.brighton.ac.uk (taylor)
- Subject: Problems with ResEdit2.1
- Date: 13 Apr 92 08:40:38 GMT
- Organization: Brighton Polytechnic, UK
-
- I have ResEdit 2.1 which seems to work fine except when I try to change the
- name or ID of a resource. Attempting to do this results in the machine
- locking up. I am using system 7.0 - does anyone else have this problem or
- have I got a duff version? Help!
-
- Paul Taylor
- Brighton Polytechnic
- England
-
- +++++++++++++++++++++++++++
-
- From: jbush@magnus.acs.ohio-state.edu (John E Bush)
- Date: 13 Apr 92 12:08:30 GMT
- Organization: The Ohio State University
-
- In article <1992Apr13.084038.29113@unix.brighton.ac.uk> pdt@unix.brighton.ac.uk
- (taylor) writes:
- >I have ResEdit 2.1 which seems to work fine except when I try to change the
- >name or ID of a resource. Attempting to do this results in the machine
- >locking up. I am using system 7.0 - does anyone else have this problem or
- >have I got a duff version? Help!
- >
- >Paul Taylor
-
- Paul,
-
- The latest version of ResEdit is 2.1.1 and is available on Apple's ftp site.
- I used to have the same problem that you are experiencing, but have not had
- the problem since I upgraded versions.
-
- Eric Bush
-
- ---------------------------
-
- From: jsuker@orion.oac.uci.edu (Johnathon L. Suker)
- Subject: Think C, TCL, AppleTalk Async calls and a question
- Organization: Univesity of California at Irvine Main Library
- Date: 10 Apr 92 22:37:50 GMT
-
- Hey AppleTalk and Think Class Library,
-
- I have a programming question regarding AppleTalk programming and
- the think class library. I am going to write (am writing) a programming
- that uses appletalk and sends syncronous calls. I want to change them to
- Async. calls. According to Inside AppleTalk, to should check for async
- calls in the main event loop of your program. In TCL I do not have access
- to this and inorder to put something in their I must changing the source
- code of TCL (which Symantec says is BAD). Has anyone (or does anyone) know
- how to make Async calls within TCL. I would really like to use the TCL (my
- first big project using it) and this is the only thing holding me back.
-
- Thanks in advance,
-
- Johnathon
- _______________________________________________________________________________
- Johnathon Suker |
- UC Irvine | .signature file under construction
- jsuker@orion.oac.uci.edu |
- _______________________________________________________________________________
-
- +++++++++++++++++++++++++++
-
- From: lkimes@alshain.usc.edu (Lance 'Moof' Kimes)
- Date: 10 Apr 1992 19:17:45 -0700
- Organization: University of Southern California, Los Angeles, CA
-
-
- In article <jsuker.23@orion.oac.uci.edu>, jsuker@orion.oac.uci.edu (Johnathon L. Suker) writes:
- |> Hey AppleTalk and Think Class Library,
- |>
- |> I have a programming question regarding AppleTalk programming and
- |> the think class library. I am going to write (am writing) a programming
- |> that uses appletalk and sends syncronous calls. I want to change them to
- |> Async. calls. According to Inside AppleTalk, to should check for async
- |> calls in the main event loop of your program. In TCL I do not have access
- |> to this and inorder to put something in their I must changing the source
- |> code of TCL (which Symantec says is BAD). Has anyone (or does anyone) know
- |> how to make Async calls within TCL. I would really like to use the TCL (my
- |> first big project using it) and this is the only thing holding me back.
- |>
- |> Thanks in advance,
- |>
- |> Johnathon
- |> _______________________________________________________________________________
- |> Johnathon Suker |
- |> UC Irvine | .signature file under construction
- |> jsuker@orion.oac.uci.edu |
- |> _______________________________________________________________________________
-
-
- When I first started TCL programming I made the same mistake, but remember that TCL is a class library!!
-
- CMyClass : public CApplication
-
-
- override Process1Event
-
- void CMyClass::Process1Event( void)
- {
-
-
- my stuff & checking
-
-
- inherited::Process1Event();
- }
-
- then call CApplication method for processing events
-
-
-
- Hope it helps
-
- Lance Kimes
- USC
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
- Date: 11 Apr 92 10:30:48 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- .uci.edu> jsuker@orion.oac.uci.edu (Johnathon L. Suker) writes:
-
- calls in the main event loop of your program. In TCL I do not have access
- to this and inorder to put something in their I must changing the source
- code of TCL (which Symantec says is BAD). Has anyone (or does anyone) know
-
- Of course you do !
-
- Your gopher will get a dawdle message, or you can install~
- CIdleChores.
-
- - --
- h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- +++++++++++++++++++++++++++
-
- From: minow@ranger.enet.dec.com (Martin Minow)
- Date: 11 Apr 92 20:33:37 GMT
- Organization: Digital Equipment Corporation
-
-
- In article <jsuker.23@orion.oac.uci.edu>, jsuker@orion.oac.uci.edu
- (Johnathon L. Suker) asks about asychronous I/O and the Think library.
-
- The simplest solution is to create a CChore to watch for I/O completion.
- If your I/O needs are more elaborate, you might want to create your
- own action queue using roughly the following algorithm:
-
- Your I/O routine (PBControl or similar) establishes an I/O completion
- handler. This is a short assembly-language stub that queues the I/O
- block into a private queue. Your CChore then looks for a non-empty
- queue and, if it finds something, dequeues the first element and
- processes it.
-
- To save you much head-scratching, create your I/O request as follows:
- struct MyIORecord {
- long applicationA5;
- ParamBlock pbRec;
- ... other data for the I/O request ...
- };
-
- Create the I/O request by
-
- anIORequest.applicationA5 = (long) CurrentA5;
- ... other parameters ...
- anIORequest.pbRec.ioCompletion = (ProcPtr) MyCompletionRoutine;
- status = PBControlAsync(&anIORequest.pbRec);
-
- The completion routine is as follows:
-
- QHdr gProcessQueue;
-
- pascal void
- MyCompletionRoutine()
- {
- asm {
- move.l a5,-(sp) ; Save current A5
- move.l -4(a0),a5 ; Restore application A5
- lea gProcessQueue,a1 ; My queue header
- _Enqueue ; Put buffer in my queue
- movea.l (sp)+,a5 ; Restore A5
- }
- }
-
- Your CChore or idle loop should call a "dequeue" function defined as follows:
-
- /*
- * Get an element from the queue, return NULL if none.
- */
- struct MyIORecord *
- GetFromQueue(void)
- {
- QHdrPtr theQueue;
- QElemPtr qElemPtr;
-
- theQueue = &gProcessQueue; /* Parameter, perhaps */
- if ((qElemPtr = theQueue->qHead) == NULL)
- return (NULL);
- else {
- Dequeue(qElemPtr, theQueue);
- return ((struct MyIORecord *) (((long) qElemPtr) - sizeof (long)));
- }
- }
-
- This was retyped from working code: apologies for any errors that crept in.
- Note that your CChore should set a short maxSleep time if the queue is
- non-empty. (The method that calls PBControlAsynch must also set a
- small value in gSleepTime.)
-
- Martin Minow
- minow@ranger.enet.dec.com
-
- ---------------------------
-
- From: fcs@teal.csn.org (M. Scott Marcy)
- Subject: Anybody know the SE "Easter Egg?"
- Organization: Colorado SuperNet, Inc.
- Date: Sat, 11 Apr 1992 05:44:15 GMT
-
- I was just wondering if anybody out there knows and remembers the address of
- the "Easter Egg" in the original SE ROMs? It's the one which draws the
- pictures of the development team.
-
- I guess while I'm at it, any other "Eggs" would be appreciated, too (other
- Macs, any software, etc.). I know the one about the Zebra Lady in
- Mac Paint II.
-
- I'll summarize to the net if I get anything new.
-
- Thanks!
-
- - -Scott
-
- - --
- M. Scott Marcy Internet: fcs@csn.org
- First Class Systems, Inc. Applelink: FIRST.CLASS
- PO Box 50005
- Colorado Springs, CO 80949 USA Disclaimer: I own the company!
-
- +++++++++++++++++++++++++++
-
- From: neal@farallon.com (Neal Trautman)
- Date: 11 Apr 92 18:55:48 GMT
- Organization: Farallon Computing, Inc.
-
- In article <1992Apr11.054415.13203@csn.org>, fcs@teal.csn.org (M. Scott Marcy) writes:
- > I was just wondering if anybody out there knows and remembers the address of
- > the "Easter Egg" in the original SE ROMs? It's the one which draws the
- > pictures of the development team.
-
- Here's the THINK C source code for a small
- application I wrote years ago to show the pictures.
-
- Enjoy...
- Neal Trautman
- Timbuktu Lead Software Engineer
- Farallon Computing, Inc.
- neal@farallon.com
-
-
- main()
- {
- SysEnvRec MacInfo;
- EventRecord theEvent;
- long time;
- int i;
-
- InitGraf(&thePort);
- InitFonts();
- FlushEvents(everyEvent, 0);
- InitWindows();
- InitDialogs(0L);
- InitCursor();
- SysEnvirons(1, &MacInfo);
- if (MacInfo.machineType != envSE)
- {
- ExitToShell();
- }
- asm
- {
- jsr 0x41D8B4
- }
- for(;;)
- {
- asm
- {
- addq.l #4,D7
- andi.l #0x0C,D7
- jsr 0x41D8D6
- }
- for (i=0; i<=8; i++)
- {
- if (Button())
- ExitToShell();
- Delay(20L,&time);
- }
- }
- }
-
- ---------------------------
-
- From: ckyu@leland.Stanford.EDU (Chen-Kuang Yu)
- Subject: debugging tools for lisp
- Date: 11 Apr 92 17:49:26 GMT
- Organization: DSG, Stanford University, CA 94305, USA
-
- I've been using lisp on the NeXT machines and recently have to do some
- programming on the mcl. However I find the STEP and TRACE debugging
- macro rather crude on the mcl. I wonder if it's mentioned in the
- manual that there are some other more powerful debugging tools
- available. (I'm using the program running on the server of our schoo.
- The consultant said the manual was lost, so there's no way for me to
- check it out.)
-
- BTW, are there any ftp sites where they keep a bunch of useful lisp
- codes such as a modified TRACE or STEP?
-
- Thank in advance.
-
- /Chen Yu (yu@cs.stanford.edu)
-
- +++++++++++++++++++++++++++
-
- From: ksand@apple.com (Kent Sandvik)
- Date: 14 Apr 92 19:36:02 GMT
- Organization: MacDTS Mongols
-
- In article <1992Apr11.174926.1639@leland.Stanford.EDU>, ckyu@leland.Stanford.EDU
- (Chen-Kuang Yu) writes:
- >
- > I've been using lisp on the NeXT machines and recently have to do some
- > programming on the mcl. However I find the STEP and TRACE debugging
- > macro rather crude on the mcl. I wonder if it's mentioned in the
- > manual that there are some other more powerful debugging tools
- > available. (I'm using the program running on the server of our schoo.
- > The consultant said the manual was lost, so there's no way for me to
- > check it out.)
-
- As I know STEP and TRACE are the default Common Lisp utilities under
- MCL. There's an inspector which you could use for inspecting data
- structures.
-
- > BTW, are there any ftp sites where they keep a bunch of useful lisp
- > codes such as a modified TRACE or STEP?
-
- cambridge.apple.com has MCL code, you might check their archives.
-
- Cheers,
- Kent Sandvik
-
- ---------------------------
-
- From: nebel@wam.umd.edu (Chris D. Nebel)
- Subject: Network copy protection problems
- Organization: University of Maryland, College Park
- Date: Sat, 11 Apr 1992 23:20:23 GMT
-
- I'm trying to write one of those things that checks to make sure that you're
- only running one copy of the same program at once on an Appletalk network.
- (Please, no flames from folks that think this practice is evil. This is my
- job we're talking about, here.) Anyway, I've got a little thing written that
- registers the "name" (all right, the serial number) of the program using
- NBPRegister; if NBPRegister comes back with a duplicate name error, then it
- decides that another copy is being run somewhere and exits. (The program
- unregisters the name when you quit.)
-
- This works pretty well, but there are two major problems. One, it only checks
- the current zone. I'd like it to check ALL the zones, but I can't seem to find
- anything at all on zones in IM except for an occasional mention of '*' -- where
- does Apple hide this information, anyway?
-
- Problem number two is more serious: if the program terminates abnormally (read:
- crashes! (or the user kills it, or whatever)), then the name never gets
- unregistered. So when they try to launch again, it says "This copy is already
- being used!" Oh, joy. I tried turning off self-send during the inital name-
- check, and that seems to work, but when it tries to unregister the name,
- something fairly horrible must happen, because the Finder almost always
- crashes a few seconds after I quit.
-
- Any tips/pointers/useful comments would be greatly appreciated.
-
- Thanks,
- Chris Nebel
- nebel@wam.umd.edu
-
- +++++++++++++++++++++++++++
-
- From: peirce@outpost.SF-Bay.org (Michael Peirce)
- Date: 12 Apr 92 16:30:37 GMT
- Organization: Peirce Software
-
-
- In article <1992Apr11.232023.11368@wam.umd.edu> (comp.sys.mac.programmer), nebel@wam.umd.edu (Chris D. Nebel) writes:
- > I'm trying to write one of those things that checks to make sure that you're
- > only running one copy of the same program at once on an Appletalk network.
- > (Please, no flames from folks that think this practice is evil. This is my
- > job we're talking about, here.) Anyway, I've got a little thing written that
- > registers the "name" (all right, the serial number) of the program using
- > NBPRegister; if NBPRegister comes back with a duplicate name error, then it
- > decides that another copy is being run somewhere and exits. (The program
- > unregisters the name when you quit.)
- >
- > This works pretty well, but there are two major problems. One, it only checks
- > the current zone. I'd like it to check ALL the zones, but I can't seem to find
- > anything at all on zones in IM except for an occasional mention of '*' -- where
- > does Apple hide this information, anyway?
-
- You need to use the Zone Information Protocol, ZIP, to find out what
- zones exist in your network. With it you can lookup the name in each
- zone.
-
- Of course, this will take FOREVER in a large network environment -
- and there are many large AppleTalk networks out there.
-
- You need to be a little more clever than just checking everywhere.
- Do something like only picking a couple of random zones each time you
- start up.
-
- Before you release your product do some serious testing of your scheme
- on a real network (at least a few dozen zones with real traffic) and
- make sure you aren't hogging all the resources or causing other problems
- for people. Your customers will be happier and so will you - you
- don't want people dumping your product because it nukes their network!
-
- > Problem number two is more serious: if the program terminates abnormally (read:
- > crashes! (or the user kills it, or whatever)), then the name never gets
- > unregistered. So when they try to launch again, it says "This copy is already
- > being used!" Oh, joy. I tried turning off self-send during the inital name-
- > check, and that seems to work, but when it tries to unregister the name,
- > something fairly horrible must happen, because the Finder almost always
- > crashes a few seconds after I quit.
-
- Patch the ExitToShell trap and do your unregistering there.
-
- Not only are you getting a duplicate name, but worse, NBP still thinks
- it owns the block of memory that contains the original name. This
- chunk of memory could very well be part of another program's memory
- space now!
-
- - -- Michael Peirce -- peirce@outpost.SF-Bay.org
- - -- Peirce Software -- Suite 301, 719 Hibiscus Place
- - -- Macintosh Programming -- San Jose, California USA 95117
- - -- & Consulting -- voice: (408) 244-6554 fax: (408) 244-6882
- - -- -- AppleLink: peirce & America Online: AFC Peirce
-
- +++++++++++++++++++++++++++
-
- From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
- Date: 12 Apr 92 22:20:23 GMT
-
- In <D2150035.0r9ddv@outpost.SF-Bay.org> peirce@outpost.SF-Bay.org (Michael Peirce) writes:
-
-
- >>[On a crash, names aren't being unregistered]
-
- >Patch the ExitToShell trap and do your unregistering there.
-
- >Not only are you getting a duplicate name, but worse, NBP still thinks
- >it owns the block of memory that contains the original name. This
- >chunk of memory could very well be part of another program's memory
- >space now!
-
- Yes, but this won't help you on a crash. I don't know how comfortable
- you might feel with patching _SysError...
-
- You will probably want to periodically want to poll the names in use,
- and simply ping each one to make sure they are still there. If there
- was a crash, you wouln't get a ping, and you might want to take some
- action there.
-
- If the user aborts (cmd-opt-esc), I don't know if _ExitToShell gets
- called. Can you rely on it always being called in the future? Perhaps
- a more future compatible way of doing this would be to make a small
- stub application that simply launches the main application. The small
- one would accept ChildDied events, then know when to release the name.
- (when its child died). If you had the main app register the name and
- the stub app remove it, I think you can be virtually guranteed future
- compatibility.
-
- - Scott
-
- +++++++++++++++++++++++++++
-
- From: zobkiw@world.std.com (Joe Zobkiw)
- Organization: The World Public Access UNIX, Brookline, MA
- Date: Mon, 13 Apr 1992 14:04:07 GMT
-
- Chris -
-
- I learned about Zones from IM VI I think...also check IM V.
-
- As far as your problem...I do the exact same thing, from within an INIT
- and it works without a hitch. You mention that if the application crashes,
- the name doesn't unregister...this could be a problem...but you would hope
- that whenever someone's machine crashes, they will restart it just to be
- safe. When the machine is restarted, the registration will disappear and
- everything will be back to normal.
-
- - --
- <--------------------------------------------------->
- joe zobkiw zobkiw@world.std.com
- mac.synthesis.MIDI.development.C.asm.communications
- >---------------------------------------------------<
-
- +++++++++++++++++++++++++++
-
- From: mwalker@wc.novell.com (Mel Walker)
- Organization: Novell, Inc.
- Date: Mon, 13 Apr 1992 14:48:13 GMT
-
- >> Problem number two is more serious: if the program terminates abnormally (rea
- d
- >> crashes! (or the user kills it, or whatever)), then the name never gets
- >> unregistered. So when they try to launch again, it says "This copy is alread
- y
- >> being used!" Oh, joy. I tried turning off self-send during the inital name-
- >> check, and that seems to work, but when it tries to unregister the name,
- >> something fairly horrible must happen, because the Finder almost always
- >> crashes a few seconds after I quit.
- >
- >Patch the ExitToShell trap and do your unregistering there.
- >
- >Not only are you getting a duplicate name, but worse, NBP still thinks
- >it owns the block of memory that contains the original name. This
- >chunk of memory could very well be part of another program's memory
- >space now!
- >
- >-- Michael Peirce -- peirce@outpost.SF-Bay.org
- >-- Peirce Software -- Suite 301, 719 Hibiscus Place
- >-- Macintosh Programming -- San Jose, California USA 95117
- >-- & Consulting -- voice: (408) 244-6554 fax: (408) 244-6882
- >-- -- AppleLink: peirce & America Online: AFC Peirce
-
-
- How does one patch the ExitToShell trap to do something? Sample or psuedo code,
- please...
-
- - --Mel Walker
- mwalker@optics.wc.novell.com
- ** I have not yet developed a snazzy disclaimer **
-
- +++++++++++++++++++++++++++
-
- From: rgg@manutius.UUCP (Rick Gordon)
- Date: 14 Apr 92 00:09:41 GMT
- Organization: Aldus Corporation, Seattle WA
-
-
- regarding "pinging" every node periodically: this has a couple of faults.
- first it generates a lot of extra traffic, AT is bad enough with broadcasts
- why make it worse?
- second it's non-deterministic: network loads can vary significantly depending
- upon hops through routers. what you might this is a failed name is not.
- of course, even if you detect the name doesn't answer, you cannot remove the
- name from that nodes name table so now you have to keep a list of those nodes
- that contain bogus names.
-
- what i would suggest if NBP Register detects a match is doing an NBP Query
- and testing the node id against the local host. (You should be doing this
- anyway in case the user has SetSelfSend turned on.) If you detect this
- situation at startup, you know it's because the name didn't properly get
- removed the last time, in which case you should probably advise the user
- to reboot. (Because NBP still has that block of memory - or thinks it does -
- containing the name that was originally registered. And who knows what's
- happened between the time your application crashed and the time it was
- relaunched!)
-
- rick_gordon@aldus.com
-
- ---------------------------
-
- From: dsb@mbunix.mitre.org
- Subject: Problem with PBHGetFInfo
- Date: 13 Apr 92 12:46:22 GMT
- Organization: The MITRE Corporation
-
- Can anyone think why this returns -43 (file not found)
-
- gMultiFiles[index]->parID is 1610667778
- gMultiFiles[index]->vRefNum is 0
- kFSAsynch is true
- - ----
- HFileParam fpb;
-
- /* prepare a hParamBlock */
- fpb.ioCompletion = nil;
- fpb.ioFVersNum = 0;
- fpb.ioFDirIndex = 0;
- fpb.ioNamePtr = CtoPstr(gMultiFiles[index]->name);
- fpb.ioVRefNum = gMultiFiles[index]->vRefNum;
- fpb.ioDirID = gMultiFiles[index]->parID;
- err = PBGetFInfo(&fpb,!kFSAsynch);
-
- when this get s info on the file. (I want to use this so I can look at files
- in different directories)
-
- FileParam fpb;
-
- fpb.ioCompletion = nil;
- fpb.ioFVersNum = 0;
- fpb.ioFDirIndex = 0;
- fpb.ioNamePtr = CtoPstr(gMultiFiles[index]->name);
- fpb.ioVRefNum = gMultiFiles[index]->vRefNum;
- err = PBGetFInfo(&fpb,!kFSAsynch);
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@byse.nada.kth.se (Jon W{tte)
- Date: 13 Apr 92 19:33:16 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- .mitre.org> dsb@mbunix.mitre.org writes:
-
- Can anyone think why this returns -43 (file not found)
-
- gMultiFiles[index]->parID is 1610667778
- gMultiFiles[index]->vRefNum is 0
-
- I have a hard time believing you ever got that many folders
- created on your disk.
-
- Instead, it looks like a large negative number or something
- like that; probably the result of assigning a wdRefNum to
- a long.
-
- Try swapping the two around, so the dirID is 0 and the
- vRefNum is whatever the parID was assigned.
-
- - --
- "You should meet yourself someday. I'm sure you would hate it."
- - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
-
- ---------------------------
-
- From: mhkohne@jupiter.cs.umbc.edu (Michael Kohne)
- Subject: Regular reading of a serial device-how?
- Date: 13 Apr 92 01:57:08 GMT
- Organization: University of Maryland Baltimore Campus, Computer Science Department
-
- I've got an interesting situation. I have come by a graphics tablet that is a
- serial device, and I want to hook it to my mac. This should be simple, as I
- know the format of the data it's sending, and I know how to use the serial
- ports on the mac. There's only one problem: I need to check the serial ports
- pretty regularly in order to do this, but the Control and Status driver
- calls might move or purge memory, and therefore can't be called from any sort
- of interrupt-level routine like a VBL task. Then I thought of using an
- interrupt routine directly, but since that would involve playing with the
- hardware directly, it's not a good idea.
-
- What I'd really like is either:
- 1) a way to call the serial drivers from a VBL task.
- 2) a way to get some code called regularly (every 10 ticks or so), but NOT
- at interrupt level. I can't think of any way either of these can be done,
- so I ask you: any ideas?
-
- respond email, and I'll post a summary.
-
- Michael Kohne
- "Pope" Q.E.D
-
- - --
- "Pope" Q.E.D Lord High Jabberwocky
- Michael Kohne mhkohne@jupiter.cs.umbc.edu
- Coded Message: FIME NDUXXMS MZP FTQ EXUFTK FAHQE SKDQ MZP SUYNXQ UZ FTQ IMNQ.
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
- Date: 13 Apr 92 08:09:17 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- > mhkohne@jupiter.cs.umbc.edu (Michael Kohne) writes:
-
- 1) a way to call the serial drivers from a VBL task.
-
- Can't help you there
-
- 2) a way to get some code called regularly (every 10 ticks or so), but NOT
- at interrupt level. I can't think of any way either of these can be done,
- so I ask you: any ideas?
-
- Hey, how about a simple application that passes a value < 10 to
- WaitNextEvent ? Could even make it faceless background...
-
- Or you could write a driver (DRVR) and have an INIT install it;
- DRVRs get regular time from SystemTask.
-
- Or you could patch one of the "regularies" like _OSEvent or
- _SystemTask - but that degrades system performance a lot.
-
- Hope this helps !
-
- - --
- "You should meet yourself someday. I'm sure you would hate it."
- - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
-
- +++++++++++++++++++++++++++
-
- From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
- Date: 14 Apr 92 18:35:40 GMT
-
- In <D88-JWA.92Apr13090917@hemul.nada.kth.se> d88-jwa@hemul.nada.kth.se (Jon W{tte) writes:
-
- >> mhkohne@jupiter.cs.umbc.edu (Michael Kohne) writes:
-
- > 2) a way to get some code called regularly (every 10 ticks or so), but NOT
- > at interrupt level. I can't think of any way either of these can be done,
- > so I ask you: any ideas?
-
- >Or you could write a driver (DRVR) and have an INIT install it;
- >DRVRs get regular time from SystemTask.
-
- >Or you could patch one of the "regularies" like _OSEvent or
- >_SystemTask - but that degrades system performance a lot.
-
- DRVRs get time, but I wouldn't exactly call it regular. If you NEED to
- be called every 10 ticks, right now a VBL task is the only way I know
- of to ensure you get the time. Most applications (and much system
- software) that I've seen don't release processor time when tracking
- mouseDowns, so if the user holds down the mouse button for more than
- ten ticks (which is not uncommon), you could be left high and dry...
-
- - Scott
-
- ---------------------------
-
- From: swb1_ltd@uhura.cc.rochester.edu (Steve Berkley)
- Subject: How to read 10 sectors per track on floppy? (Repost)
- Date: 13 Apr 92 14:55:22 GMT
- Organization: University of Rochester - Rochester, New York
-
- I'm posting this question again, in case anyone didn't see the
- original.
-
- I'm looking for a way to read sectors off of diskettes for a
- keyboard sampler, which are formatted quite like IBM diskettes-
- 10 sectors per track, 80 tracks on two sides. The mac drive
- (.sony driver) reads at 8-12 sectors per track, depending on the
- location of the track on the physical disk (for optimum storage
- space). What I'd like to do is be able to tell the driver to
- read sectors 0-9 on *each* track.
-
- Most have said that this requires a new driver...lots of work.
- Does anyone have a simple solution?
-
- - -Steve Berkley
- swb1_ltd@uhura.cc.rochester.edu
-
- +++++++++++++++++++++++++++
-
- From: russotto@eng.umd.edu (Matthew T. Russotto)
- Date: 13 Apr 92 17:09:27 GMT
- Organization: College of Engineering, University of Maryland, College Park
-
- In article <1992Apr13.145522.4052@galileo.cc.rochester.edu> swb1_ltd@uhura.cc.rochester.edu (Steve Berkley) writes:
- >I'm posting this question again, in case anyone didn't see the
- >original.
- >
- >I'm looking for a way to read sectors off of diskettes for a
- >keyboard sampler, which are formatted quite like IBM diskettes-
- >10 sectors per track, 80 tracks on two sides. The mac drive
- >(.sony driver) reads at 8-12 sectors per track, depending on the
- >location of the track on the physical disk (for optimum storage
- >space). What I'd like to do is be able to tell the driver to
- >read sectors 0-9 on *each* track.
-
- You can't do this on an 800K drive, but if you have an FDHD (and
- appropriate support chips), ask the .Sony driver to read it in IBM
- format-- the tech notes have the documentation for that driver.
-
- Originally you said that the diskette was recorded in GCR format. If
- so, you have a really strange disk, and will need to write a new
- driver. I didn't know anyone other than Apple used GCR for 3.5"
- floppies.
-
-
- - --
- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu
- Some news readers expect "Disclaimer:" here.
- Just say NO to police searches and seizures. Make them use force.
- (not responsible for bodily harm resulting from following above advice)
-
- ---------------------------
-
- From: neal@farallon.com (Neal Trautman)
- Subject: WWDC Dinner?
- Date: 9 Apr 92 13:29:36 GMT
- Organization: Farallon Computing, Inc.
-
-
- Is there any info on an Internetters dinner at
- Apple's World Wide Developer Conference?
-
- - --
- Neal Trautman
- Timbuktu Lead Software Engineer
- Farallon Computing, Inc.
- neal@farallon.com
-
- +++++++++++++++++++++++++++
-
- From: peirce@outpost.SF-Bay.org (Michael Peirce)
- Date: 14 Apr 92 00:10:57 GMT
- Organization: Peirce Software
-
-
- In article <254@farallonfarallon.com> (comp.sys.mac.programmer), neal@farallon.com (Neal Trautman) writes:
- >
- > Is there any info on an Internetters dinner at
- > Apple's World Wide Developer Conference?
-
- Sure is. It's been talked about some here already. Thursday is the
- night and Gorden Biersch is the place. Send me email to have your
- name put on the reservation list.
-
- - -- Michael Peirce -- peirce@outpost.SF-Bay.org
- - -- Peirce Software -- Suite 301, 719 Hibiscus Place
- - -- Macintosh Programming -- San Jose, California USA 95117
- - -- & Consulting -- voice: (408) 244-6554 fax: (408) 244-6882
- - -- -- AppleLink: peirce & America Online: AFC Peirce
-
- ---------------------------
-
- From: dfrick@uhunix.uhcc.Hawaii.Edu (Doug Frick)
- Subject: archive site for Frontier stuff?
- Date: 13 Apr 92 17:54:24 GMT
- Organization: University of Hawaii at Manoa
-
- I'm posting the following in hopes that someone out in Netland is
- interested in supporting an archive site for Frontier-related
- stuff. It is a pretty cool application, and allows all us Mac
- techies to script our environments.
- - ---------------------------------------------------------------------------
- From: EL.GRANDE@AppleLink.Apple.COM (UserLand SW, David Winer,PRT)
-
- Doug:
-
- We're not on the Internet at all. If you know anyone who might want to act as a
- pipeline for demo scripts, toolkits and install files, we'd love to open the
- channel.
-
- Is there some place you could re-post this message? We're looking for someone
- with both an Internet and an AppleLink or CompuServe account.
-
- This question comes up all the time and we'd really like to get in the loop.
- Getting educated on Internet culture isn't an option for us right now, we're
- overloaded with supporting AppleLink and CompuServe. That may change, but not
- in the next few months...
-
- DW
- - --
- Doug Frick
- dfrick@uhunix.uhcc.Hawaii.edu
-
- ---------------------------
-
- From: winer@husc8.harvard.edu (Adam Winer)
- Subject: What is Discipline?
- Date: 13 Apr 92 18:52:04 GMT
-
-
- Does anyone out there know what Discipline is? I downloaded it from
- ftp.apple.com a couple days ago. It appears to be some sort of a
- debugging tool, but the instructions that came with it were
- extremely skimpy. Is it designed for use with Macsbug (which I have)
- or with MPW (which I don't have)? Does anyone have access to complete
- instructions?
-
- Thanks,
- Adam
- - --
- Adam Winer | The number you have reached is imaginary.
- WINER@HARVARD.EDU | Please rotate your phone 90 degrees and
- | try again.
-
- +++++++++++++++++++++++++++
-
- From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
- Organization: University of Illinois at Urbana
- Date: Mon, 13 Apr 1992 20:24:55 GMT
-
- winer@husc8.harvard.edu (Adam Winer) writes:
-
-
- >Does anyone out there know what Discipline is? I downloaded it from
- >ftp.apple.com a couple days ago. It appears to be some sort of a
- >debugging tool, but the instructions that came with it were
- >extremely skimpy. Is it designed for use with Macsbug (which I have)
- >or with MPW (which I don't have)? Does anyone have access to complete
- >instructions?
-
- It's a parameter checker for Toolbox calls; i.e. it will complain if you
- pass obviously wrong stuctures to the Toolbox. For example, a rectangle
- with right < left (the Finder tends to do this!). Turn it on in macsbug
- with 'dsca'; the same command toggles it off. 'dsc' will turn it on/off for
- the entire machine rather than only the current application, but you don't want
- to do this (unless you feel like it complaining about the Finder).
- - --
- Mark Lanett, Software Tools Group, NCSA mlanett@uiuc.edu or NCSA.STG
- "People wander in and out of virtual rooms in virtual settings with virtual
- characters and virtual money and virtual armor and virtual weapons, which is
- virtually a good way to spend time, but not quite." -- Usenet Oracle
-
- +++++++++++++++++++++++++++
-
- From: nagle@netcom.com (John Nagle)
- Date: Tue, 14 Apr 92 00:06:22 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
-
- winer@husc8.harvard.edu (Adam Winer) writes:
- >Does anyone out there know what Discipline is? I downloaded it from
- >ftp.apple.com a couple days ago. It appears to be some sort of a
- >debugging tool, but the instructions that came with it were
- >extremely skimpy. Is it designed for use with Macsbug (which I have)
- >or with MPW (which I don't have)? Does anyone have access to complete
- >instructions?
- Discipline is documented, more or less, in the Macsbug manual,
- which can be ordered from APDA.
-
- Discipline is an attempt to remedy the fact that the Mac toolbox,
- operating system, and packages don't adequately check arguments on calls.
- When started, Discipline reads in a file of interpretive statements
- which define checks to be made for each system and toolbox call.
- These checks are then made when checking is enabled with a Macsbug
- command. The checker is slow; turning on Discipline may slow programs
- by an order of magnitude. (If these checks were built into the Toolbox
- code, they'd probably only cost a few percent performance).
-
- When Discipine detects an error, it causes a trap to Macsbug, with
- a reasonable error message identifying the problem.
-
- Discipline doesn't distinguish clearly between calls which are
- flatly wrong and calls which are returning an unusual result. Attempting
- to read in a resource that isn't present will cause a Discipline trap,
- even for calls where this just returns an error code, without causing
- "undefined results", as IM puts it. This reflects a Lint-like approach
- to error handling, where false alarms are a problem.
-
- Annoyingly, the Finder isn't clean enough to pass Discipline, and
- running under MultiFinder (at least prior to System 7) with Discipline
- on generates occasional traps. This really ought to be fixed; there are
- only a few places where the Finder fails Discipline checks. (The
- Macsbug manual has an amusing comment on this subject, along the
- lines of "nothing is wrong, it's OK for Apple code to violate Discipline)
- Haven't tried this under system 7 yet.
-
- Discipline ranks with "lint" as a concept; it is intended to
- catch common errors, not to guarantee that specific classes of errors
- have been eliminated.
-
- John Nagle
-
- ---------------------------
-
- From: johnson@vixvax.mgi.com
- Subject: 32K boundary problem?
- Date: 13 Apr 92 20:42:24 GMT
- Organization: Management Graphics, Inc.
-
- Can someone help me with this problem?
-
- I'm programming in C using MPW 3.0 and have run into a problem related
- the size of an array. The program works as the following:
-
- #define MAXLINES 4096
-
- void routine(void) {
- rcPtr scanList[MAXLINES];
- ...
-
- but the program bombs on the call to _routine_ if MAXLINES is declared
- as 8192. (rcPtr is an 8 byte structure by the way).
-
- This has to be a 32K boundary problem. How do I get around it (short of
- redefining my algorithm to eliminate the array, please).
-
- Thanks in advance.
- - --
- ******************************************************************************
- * Woody Johnson * johnson@vixvax.mgi.com * I used to paint the princess*
- * 10816 Quinn Ave S * Management Graphics, Inc * I used to paint the frogs *
- * Bloomington, MN * 1401 E 79th St, #6 * Now paint mustaches *
- * 55437 * Bloomington, MN 55425 * on dangerous dogs *
- * * * - Don Henley *
- ******************************************************************************
-
- +++++++++++++++++++++++++++
-
- From: time@ice.com (Tim Endres)
- Date: 14 Apr 92 02:27:48 GMT
- Organization: ICE Engineering, Inc.
-
-
- In article <1992Apr13.154225.1766@vixvax.mgi.com> (comp.sys.mac.programmer), johnson@vixvax.mgi.com writes:
- > #define MAXLINES 4096
- >
- > void routine(void) {
- > rcPtr scanList[MAXLINES];
- > ...
- >
- > but the program bombs on the call to _routine_ if MAXLINES is declared
- > as 8192. (rcPtr is an 8 byte structure by the way).
- >
- > This has to be a 32K boundary problem. How do I get around it (short of
- > redefining my algorithm to eliminate the array, please).
-
- This is more likely your stack crawling down over the top of your
- heap. Remember that the heap and stack grow towards eachother. What
- you need to do is decrease the fire wall that limits the heap's growth,
- which allows the stack to get bigger without clobbering it. Here is
- the a sample of increasing your "stack size":
-
- /* Increase stack space by 16,000 bytes */
-
- SetApplLimit(GetApplLimit() - 16000);
-
- /* Expand the application heap zone to the maximum. */
-
- MaxApplZone();
-
- /* Allocate some master pointers. */
-
- MoreMasters();
- MoreMasters();
- MoreMasters();
-
- InitGraf(&qd.thePort);
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(NULL);
- InitAllPacks();
-
-
- tim endres - time@ice.com -or- uupsi!tbomb!time
- ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
- 8840 Main Street, Whitmore Lake, MI 48189
- USENET - a slow moving self parody... ph
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-